#pragma once
#include "Common.h"
#include "ObjectPool.h"
#include <unordered_map>
class PageCache
{
public:
	static PageCache* getinstance()
	{
		return &_sInt;
	}
	 static span* newspan(size_t k);
	 static span* mapobjecttospan(void* obj);

	//获取centralcache空闲的span
	void RealsespantoPage(span* span);
private:
	static MemoryPool<span> _spanPool;
	 static Spanlist _spanlist[NPAGES];
	 static std::unordered_map<PAGE_ID, span*> _isSpanmap;
	PageCache()
	{
	};
	PageCache(const PageCache&) = delete;
	static PageCache _sInt;
};